package com.atguigu.distributed.lock.jvm;

import java.util.Random;

public class GCDemo {
    public static void main(String[] args) {
                String str = "atguigu";
        while (true){
            str+= str+new Random().nextInt(1111)+new Random().nextInt(2222222);
            str.intern();//Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        }
    }
}
